<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>编辑自由行拼游</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <!--<script src="{$Think.config.httpFlag}{$Think.config.google_map_url}" async="async"></script>-->
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style>
        #admin dl{z-index:99999;}
        .pro_li,.trip_li{
            border-bottom: 1px dashed #efefef;
        }
        .carAndTicketCurrency{
            text-align: left;
            padding-left:0;
            padding-right:0;
            position: absolute;
            top: 10px;
            left: 520px;
        }
        .busySeason{
            color:red;
        }
    </style>

</head>
<body>
<fieldset class="layui-elem-field site-demo-button" style="border:0;margin:30px 0 10px 30px;">
    <div class="layui-btn layui-btn-normal" onclick="window.history.back(-1)">返回</div>
</fieldset>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>编辑当前拼游团信息</legend>
</fieldset>
<form class="layui-form" id="admin">
    <!--标题-->
    <div class="layui-form-item">
        <label class="layui-form-label">主题名称</label>
        <div class="layui-input-block" style="max-width:620px;">
            <input name="free_title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input" type="text" {notempty name="$info.free_title"}value="{$info.free_title}"{/notempty}>
        </div>
    </div>
    <!--出行日期-->
    <div class="layui-form-item">
        <label class="layui-form-label">出行日期</label>
        <div class="layui-input-block" style="max-width:620px;">
            <input readonly name="start_date" id="start_date" lay-verify="start_date" autocomplete="off" placeholder="请输入日期" class="layui-input" type="text" {notempty name="$info.start_date"}value="{$info.start_date}"{/notempty}>
        </div>
    </div>
    <div class="layui-form-item">
    <!--总人数-->
        <label class="layui-form-label">招募人数</label>
        <div class="layui-input-block" style="max-width:620px;">
            <input readonly name="max_people_num" id="max_people_num" lay-verify="max_people_num" autocomplete="off" class="layui-input" type="text" {notempty name="$info.max_people_num"}value="{$info.max_people_num}"{/notempty}>
        </div>
    </div>
    <!--已参加人数-->
    <div class="layui-form-item">
        <label class="layui-form-label">参与人数</label>
        <div class="layui-input-block" style="max-width:620px;">
            <input readonly name="cur_people_num" id="cur_people_num" lay-verify="cur_people_num" autocomplete="off" class="layui-input" type="text" {notempty name="$info.cur_people_num"}value="{$info.cur_people_num}"{/notempty}>
        </div>
    </div>
    <!--出发地城市-->
    <div class="layui-form-item">
        <div class="layui-form-item">
            <label class="layui-form-label">出发地城市</label>
            <div class="layui-input-inline" style="position: relative;width: 400px">
                <select id="trip_class" name="start_city" lay-filter="addtrips_class" lay-verify="required" lay-search>
                    <option selected value="">请选择</option>
                    {volist name="city" id="vo"}
                    <option value="{$vo.id}" {notempty name='info'}{if $vo.id==$info.start_city}selected{/if}{/notempty}>{$vo.name}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <!--目的地城市-->
    <div class="layui-form-item">
        <div class="layui-form-item">
            <label class="layui-form-label">目的地城市</label>
            <div class="layui-input-inline" style="position: relative;width: 400px">
                <select name="end_city" lay-filter="addtrips_class" lay-verify="required" lay-search>
                    <option selected value="">请选择</option>
                    {volist name="city" id="vo"}
                    <option value="{$vo.id}" {notempty name='info'}{if $vo.id==$info.end_city}selected{/if}{/notempty}>{$vo.name}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <!--拼团简介-->
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">自由行简介</label>
        <div class="layui-input-block" style="max-width:620px;">
            <textarea placeholder="请输入自由行简介" class="layui-textarea" name="free_desc">{notempty name="$info.free_desc"}{$info.free_desc}{/notempty}</textarea>
        </div>
    </div>
    <!--备注-->
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block" style="max-width:620px;">
            <textarea placeholder="请输入备注" class="layui-textarea" name="remark">{notempty name="$info.remark"}{$info.remark}{/notempty}</textarea>
        </div>
    </div>
    <!--关联拼团-->
    <div class="layui-form-item">
        <div class="layui-form-item">
            <label class="layui-form-label">关联拼团</label>
            <div class="layui-input-inline" style="position: relative;width: 620px">
                <select name="grouptour_id" lay-verify="required" lay-search>
                    <option selected value="">请选择</option>
                    {volist name="tourlist" id="vo"}
                    <option value="{$vo.line_id}" {notempty name='info'}{if $vo.line_id==$info.grouptour_id}selected{/if}{/notempty}>{$vo.title}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>

    {notempty name="$info"}
    <input type="hidden" name="id" value="{$info.id}">
    {/notempty}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="admin">保存</button>
        </div>
    </div>
</form>
<!--分隔线-->
<hr class="layui-bg-blue" style="height:1px;">
<!--报名用户-->
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>报名用户列表</legend>
</fieldset>
<table class="layui-table" lay-even="" lay-skin="line" id="freegroupmember">
    <colgroup>
        <col width="50">
        <col width="100">
        <col width="100">
        <col width="80">
        <col width="60">
        <col width="60">
        <col width="80">
        <col width="100">
        <col width="80">
        <col width="100">
        <col width="80">
        <col width="80">
        <col width="120">
        <col width="80">
    </colgroup>
    <thead>

    <tr>
        <th >ID</th>
        <th >参与者</th>
        <th >联系方式</th>
        <th >邮箱</th>
        <th >微信</th>
        <th >报名人数</th>
        <th >当前状态</th>
        <th >报名时间</th>
        <th >操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="memberlist" id="vo"}
    <tr>
        <td>{$vo.id}</td>
        <td>
            <a href="/admin/personal/index/id/{$vo.member_id}" class="showMember">{$vo.member_nickname}</a>
            {if $vo.is_owner==1}<span class="layui-badge layui-bg-orange">主</span>{/if}
        </td>
        <td>{$vo.country_code}{$vo.phone}</td>
        <td>{$vo.email}</td>
        <td>{$vo.wechat}</td>
        <td>{$vo.people_num}</td>
        <td>{$vo.status_title}</td>
        <td>{$vo.create_time}</td>
        <td class="operation-menu">
            <a href="{:url('admin/grouptoursline/freegroupmemberinfo',['id'=>$vo.id])}" class="layui-btn layui-btn-xs layui-btn-info editmemberinfo"  style="margin-right: 0;margin-top:2px;font-size:12px;margin-bottom:4px">编辑</a>
            <!--<a class="layui-btn layui-btn-xs layui-btn-danger delete" codeid="{$vo.id}" style="margin-right: 0;margin-top:2px;font-size:12px;margin-bottom:4px">删除</a>-->
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
<div>{$memberlist->render()}</div>
<div style="margin-bottom: 100px;"></div>
<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>
<script>
    layui.use(['layer', 'form','laydate'], function() {
        var layer = layui.layer,
            $ = layui.jquery,
            form = layui.form;
        laydate = layui.laydate;
        // laydate.render({     //创建时间选择框
        //     elem: '#start_date' //指定元素
        //     ,format: 'yyyy-MM-dd'
        // });
        $(window).on('load', function() {
            form.on('submit(admin)', function(data) {
                $.ajax({
                    url:"{:url('admin/grouptoursline/freegroupinfo')}",
                    data:$('#admin').serialize(),
                    type:'post',
                    async: false,
                    success:function(res) {
                        if(res.code > 0) {
                            layer.msg(res.msg);
                            setTimeout(function(){
                                window.location.reload();
                            },1000)
                        } else {
                            layer.msg(res.msg);
                        }
                    }
                })
                return false;
            });
        });
        $(".showMember").click(function(){
            var url = $(this).attr('href');
            layer.open({
                type:2,
                content:url,
                area: ['40%', '80%'],
                end:function(){
                    location.reload();
                }
            });
            return false;
        })
        $('.editmemberinfo').click(function(){
            var url = $(this).attr('href');
            layer.open({
                type:2,
                content:url,
                area: ['80%', '80%'],
                end:function(){
                    location.reload();
                }
            });
            return false;
        })
    })
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    //拼团详情暂时隐藏
    $(function(){
        // var ue2 = UE.getEditor('desc',{
        //     initialFrameHeight: 100,
        //     initialFrameWidth: 600,
        //     toolbars:[
        //         [ 'source'],
        //         ['bold', 'italic', 'underline', 'fontborder', 'strikethrough']
        //     ]
        // });
    })
</script>
</body>
</html>
